<!-- SimpleClient.jsp -->
<html>
<head>
<!-- phprpc all in one ccompressed 懶人包-->
<script src="phprpc-all-compressed.js"></script>
<script>
	var registerFunc = [ "get", "set" ];
	var phprpcHost = "";
	var contextPath = "<%=request.getContextPath()%>";
	var phprpcPath = "/PhprpcTest.phprpc";
	var client = new PHPRPC_Client(
					// server full path
					phprpcHost + contextPath + phprpcPath,
					// register function array
					registerFunc);
	// 顯示 server 回應內容
	var showResult = function(result) {
		alert(result);
	}

	function onGet() {
		client.get(showResult);
	}

	function onSet() {
		client.set("Greeting", showResult);
	}
</script>
</head>
<button onclick="onGet();">get</button>
<button onclick="onSet();">set</button>
</html>